home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Phenomena_MusicDream.lha / MusicDreamHD / Install-MusicDream next >
Text File  |  2001-03-20  |  4KB  |  225 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")        ;name of the readme file
  4. (set #highs-file "highs")        ;name of high scores file
  5.  
  6. (procedure P_MakeImages
  7.  
  8.   ;the following lines must be copied and adjusted for multiple disk images
  9.  
  10.   (set #CI_disknum 1)
  11.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  12.   (set #CI_disklen 901120)
  13.   (set #CI_skiptrk -1)
  14.   (P_CreateImage)
  15.  
  16. )
  17.  
  18. ;****************************
  19. ;----------------------------
  20. ; checks if given program is installed, if not abort install
  21. ; #program - to check
  22.  
  23. (procedure P_ChkRun
  24.   (if
  25.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  26.     ("")
  27.     (abort 
  28.       (cat
  29.     "You must install \"" #program "\" first!\n"
  30.     "It must be accessible via the path.\n"
  31.     "You can find it in the WHDLoad package."
  32.       )
  33.     )
  34.   )
  35. )
  36.  
  37. ;----------------------------
  38. ; Create Image using DIC
  39. ; #dest        - path to save image in
  40. ; #CI_disknum  - number of the disk image to create
  41. ; #CI_diskname - label of the disk
  42. ; #CI_disklen  - length of disk image to create
  43. ; #CI_skiptrk  - track to skip, -1 means no skip
  44. ; #CI_drive    - drive to create image from
  45.  
  46. (procedure P_CreateImage
  47.   (message
  48.     (cat
  49.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  50.     "(make sure it's the right disk because it will not be checked)"
  51.     )
  52.   )
  53.   (if
  54.     (>= #CI_skiptrk 0)
  55.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  56.     (set #option "")
  57.   )
  58.   (if
  59.     (= 0
  60.       (run 
  61.         (cat
  62.           "cd \"" #dest "\"\n"
  63.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  64.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  65.         )
  66.       )
  67.     )
  68.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  69.     (abort "\"DIC\" has failed to create a diskimage")
  70.   )
  71. )
  72.  
  73. ;****************************
  74.  
  75. (if
  76.   (exists #readme-file)
  77.   (if
  78.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  79.     ("")
  80.     (run ("SYS:Utilities/More %s" #readme-file))
  81.   )
  82. )
  83.  
  84. (set #program "WHDLoad")
  85. (P_ChkRun)
  86.  
  87. (set #program "DIC")
  88. (P_ChkRun)
  89.  
  90. ; in expert mode ask for source drive
  91. (if
  92.   (= @user-level 2)
  93.   (
  94.     (set #CI_drive
  95.       (askchoice
  96.     (prompt "Select source drive for diskimages")
  97.     (default 0)
  98.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  99.     (help @askchoice-help)
  100.       )
  101.     )
  102.     (select #CI_drive
  103.       (set #CI_drive "DF0:")
  104.       (set #CI_drive "DF1:")
  105.       (set #CI_drive "RAD:")
  106.       (set #CI_drive
  107.         (askstring
  108.           (prompt "Select source drive for diskimages")
  109.           (default "DF0:")
  110.           (help @askstring-help)
  111.         )
  112.       )
  113.     )
  114.   )
  115.   (set #CI_drive "DF0:")
  116. )
  117.  
  118. (set @default-dest
  119.   (askdir
  120.     (prompt 
  121.       (cat
  122.     "Where should \"" @app-name "\" be installed?\n"
  123.     "A drawer \"" @app-name "\" will be automatically created."
  124.       )
  125.     )
  126.     (help @askdir-help)
  127.     (default @default-dest)
  128.     (disk)
  129.   )
  130. )
  131. (set #dest (tackon @default-dest @app-name))
  132. (if
  133.   (exists #dest)
  134.   (
  135.     (set #choice
  136.       (askbool
  137.         (prompt
  138.           (cat
  139.             "\nDirectory \"" #dest "\" already exists.\n"
  140.             "Should it be deleted?"
  141.           )
  142.         )
  143.         (default 1)
  144.         (choices "Delete" "Skip")
  145.         (help @askbool-help)
  146.       )
  147.     )
  148.     (if
  149.       (= #choice 1)
  150.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  151.     )
  152.   )
  153. )
  154. (makedir #dest
  155.   (help @makedir-help)
  156.   (infos)
  157. )
  158.  
  159. ;----------------------------
  160.  
  161. (copyfiles
  162.   (help @copyfiles-help)
  163.   (source ("%s.Slave" @app-name))
  164.   (dest #dest)
  165. )
  166. (if
  167.   (exists ("%s.newicon" @app-name))
  168.   (set #icon
  169.     (askchoice
  170.       (prompt "\nWhich icon would you like to install?\n")
  171.       (default 0)
  172.       (choices "Normal" "NewIcon")
  173.       (help @askchoice-help)
  174.     )
  175.   )
  176.   (set #icon 0)
  177. )
  178. (select #icon
  179.   (set #icon ("%s.inf" @app-name))
  180.   (set #icon ("%s.newicon" @app-name))
  181. )
  182. (copyfiles
  183.   (help @copyfiles-help)
  184.   (source #icon)
  185.   (newname ("%s.info" @app-name))
  186.   (dest #dest)
  187. )
  188. (if
  189.   (exists #readme-file)
  190.   (copyfiles
  191.     (help @copyfiles-help)
  192.     (source #readme-file)
  193.     (dest #dest)
  194.   )
  195. )
  196. (if
  197.   (exists ("%s.info" #readme-file))
  198.   (
  199.     (copyfiles
  200.       (help @copyfiles-help)
  201.       (source ("%s.info" #readme-file))
  202.       (dest #dest)
  203.     )
  204.     (tooltype
  205.       (dest (tackon #dest #readme-file))
  206.       (noposition)
  207.     )
  208.   )
  209. )
  210. (if
  211.   (exists #highs-file)
  212.   (copyfiles
  213.     (help @copyfiles-help)
  214.     (source #highs-file)
  215.     (dest #dest)
  216.   )
  217. )
  218.  
  219. (P_MakeImages)
  220.  
  221. ;----------------------------
  222.  
  223. (exit)
  224.  
  225.